package com.heima.kafka.consumer;

import lombok.extern.slf4j.Slf4j;
import org.apache.kafka.clients.consumer.Consumer;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

/**
 * @author xiaquanen
 * @version 1.0
 * @project heima-leadnews
 * @date 2024/7/29 10:18:10
 */
@Component
@Slf4j
public class KafkaConsumer {
    @KafkaListener(topics = "topic-itheima")
    public void onMessage(ConsumerRecord message) {
        log.info("接收到消息：" + message);
    }
}
